package com.wyl.spelAndAop.controller;

import com.wyl.spelAndAop.dto.City;
import com.wyl.spelAndAop.dto.Person;
import com.wyl.spelAndAop.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 吴宇亮 on 2023/4/11 10:31
 */
@RestController
public class HelloController {

    @Autowired
    private HelloService helloService;

    @RequestMapping("/hello")
    public String hello() {
        helloService.hello("hello",
                new Person()
                        .setCity(new City().setName("广州"))
                        .setName("张三")
        );
        return "hello";
    }
}
